<?php 
if (isset($_POST['username'])){
    if ('admin' == $_POST['username'] && 'hiadmin'== $_POST['password']){
        $key=base64_encode('selimadmin');
        setcookie("weuid", $key, time()+7200);
        echo json_encode(array('state'=>'success','info'=>'','referer'=>'?c=hx'));
    }else{
        echo json_encode(array('state'=>'fail','info'=>'用户名或密码错误'));
    }
}

?>